﻿#include <iostream>
using namespace std;

// 实现求1-3+5-7+...-99+101....的前n项和。
int add(int n)
{
	int sum = -3, num = -1,x=0,y=0;
	for (int i = 1; i <= n; i = i + 2)
	{
		sum += 4;
		x += sum;
	}
	for (int j = 2; j <= n; j = j + 2)
	{
		num += 4;
		y += num;
	}
	if (n<2)
	{
		return x;
	}
	return x-y;
}
int main()
{
	cout << add(4) << endl;
	
}